<?php
class Zend_Controller_Action_Helper_Common extends Zend_Controller_Action_Helper_Abstract {
	
	public function validateCaptcha($captcha) {
		$captchaId = $captcha ['id'];
		// And here's the user submitted word...  
		$captchaInput = $captcha ['input'];
		// We are accessing the session with the corresponding namespace  
		// Try overwriting this, hah!  
		$captchaSession = new Zend_Session_Namespace ( 'Zend_Form_Captcha_' . $captchaId );
		// To access what's inside the session, we need the Iterator  
		// So we get one...  
		$captchaIterator = $captchaSession->getIterator ();
		// And here's the correct word which is on the image...  
		$captchaWord = $captchaIterator ['word'];
		// Now just compare them...  
		if ($captchaInput == $captchaWord) {
			return true;
		} else {
			return false;
		}
	}
}

?>